Introduction

This vignette demonstrates the main workflow of the CFSTRenD package for manipulating, analyzing, and visualizing tree-ring data and model performance.

The workflow includes:

  • Data loading, to import raw measurements and prepare them for analysis.

  • Data processing, which organizes and formats the data for subsequent steps.

  • Quality assessment, ensuring the reliability and consistency of the measurements.

  • Modeling, where growth trends and patterns are analyzed.

As illustrated in the following diagram, visual inspection is provided at each step to facilitate assessment of data quality and validation of results.

1. Load Example Data

# Example: load a dataset included in the package
# ring measurement
samples69.o <- fread(system.file("extdata", "samples69.csv", package = "CFSTRenD"))
# climate
clim69 <- fread(system.file("extdata", "clim69.csv", package = "CFSTRenD"))

2. data processing

formatting data

# formatting the users' data conformed to CFSTRenD

# 
samples69.trt <- CFS_format(data = list(samples69.o, 39:140), usage = 1, out.csv = NULL)
#> [1] "you have filled all the mandatory information"
#> [1] "you have filled all the un-mandatory information"
class(samples69.trt)
#> [1] "cfs_format"


arguments of CFS_format() function:

data

All information should be provided in a single file in wide format, with metadata first, followed by the ring-width measurements (in mm).

The column names for the ring-width measurements can follow two formats to indicate the year of measurement:

  • Directly as the year (e.g., 1980)

  • Prefixed with a character (e.g., X1980)

It is highly recommended that the ring-width measurement columns are ordered by year and consecutive in the dataset, as the column indices will be used as input for the function CFS_format().

data = list (samples69.o, 39:140)), the second item refers to the column indices

usage

If users intend to submit their data to the CFSTRenD online repository, set usage = 1 in the function. This will enable the function to format the data structure and perform detailed checks, including column names, geographic coordinates, species, and other requirements to conform to the CFSTRenD collection standards.

Otherwise, use usage = 2 to perform a reduced checking procedure, which still builds the CFSTRenD structure but skips some of the detailed validations.

out.csv

if user wants to export the processed tables in csv format, specify the folder here. the default is NULL.

Note: Running the function CFS_format() is the first and mandatory step before using any other functions in the CFSTRenD package. The data provided in this tutorial is already prepared to run the vignette; in practice, users may need to add or modify their own data based on the messages generated by the function.


generate data report:

The data report provides an overview of the tree ring data’s quality and characteristics at four levels: project, project-species, project-species-site, and project-species-radii, including the quality assessment at site and radii levels with the default parameters. More details on quality assessment will be presented next section.


outfile_data <- tempfile(fileext = ".html")
generate_report(robj = samples69.trt, qa.label_data = "CFS-TRenD V1.2 proj69 ", data_report.reports_sel = c(1,2,3,4), output_file = outfile_data)
arguments of the generate_report() function:

robj

The input for the data report is the output of the CFS_format() function, which assigns the class “cfs_format” to the resulting object.

qa.label_data

A short description of the input dataset. This text will appear in the report as the data source for the generated figures.

data_report.reports_sel

This argument specifies the level of data summaries to be included in the reports. Valid options are 1, 2, 3, or 4, each corresponding to one of the four available report types. In this tutorial, we demonstrate only the project–species level summary.

output_file

This argument allows users to export the HTML-formatted report to a specified location by providing a folder and filename (e.g., “path/to/report.html”). If left as NULL (default), the report will not be saved to disk and will instead open directly in the browser for viewing.


data summary report



This report provides an overview of the tree ring data’s quality and characteristics at four levels:

1. project: Data Completeness: Assessment of missing or incomplete data of the whole data;
2. project-species: Data Summary: Summary statistics and descriptions;
3. project-species-site: data summary tables and series graphing; 
4. project-species-site-radii: Correlation Analysis and quality assessment. 



project name: Douglas-fir retrospective monitoring

selected reports: 1, 2, 3, 4



data completeness


This table presents the completeness of each variable of the whole dataset as a percentage. A value of 0 indicates no effective data. Please carefully verify that all required data has been included in the submission.

var pct
tr1_submission_id 100
tr1_project_name 100
tr1_description 100
tr1_year_range 100
tr1_reference 100
tr1_open_data 100
tr1_contact1 100
tr1_contact2 100
tr2_site_id 100
tr2_latitude 100
tr2_longitude 100
tr2_datasource 100
tr2_investigators 100
var pct
tr2_province_iso_code 100.0
tr3_tree_id 100.0
tr3_species 100.0
tr4_meas_no 0.0
tr4_meas_date 100.0
tr4_status 100.0
tr4_dbh_cm 98.8
tr4_ht_tot_m 99.2
tr5_sample_id 100.0
tr5_sample_type 100.0
tr5_sample_ht_m 0.0
tr5_sample_diameter_cm 0.0
var pct
tr6_radius_id 100.0
tr6_cofecha_id 0.0
tr6_ring_meas_method 100.0
tr6_crossdating_visual 100.0
tr6_crossdating_validation 100.0
tr6_age_corrected 0.0
tr6_bark_thickness_mm 0.0
tr6_radius_inside_cm 100.0
tr6_dtc_measured_mm 100.0
tr6_dtc_estimated_mm 65.8
tr6_rw_ystart 100.0
tr6_rw_yend 100.0
tr6_comments 0.0

Data Summary (Species)


This section presents key summary statistics, including spatial and temporal ranges, summary of ring width measurements, series length, etc., categorized by species.


In this dataset, there’s 1 species: PSEUMEN


*Number of series that passed the test of CFS_qa() on differentiated series

**The values refer to mean ± sd (min, max)



site-level data summary


This section presents site-level data summaries, including a figure showing ring width measurements over time and a table with key statistics.


PSEUMEN on ring width measurement




This table provides a site-level summary, including the series length, raw ring width measurements, the median ring width, the median ring width of its 10 closest neighbors, and the ratio between them. This offers insights into potential outliers caused by scaling issues.

PSEUMEN
site_id lon lat Nb. trees len.series** rw(mm)** median rw(mm) neigh median rw(mm) ratio_rw*
X003b -123.9337 48.96656 8 64.3 ± 5.78 ( 54, 70 ) 2.79 ± 0.56 ( 0.58, 6.64 ) 2.46 1.560 1.58
X003a -123.9339 48.96615 7 63.96 ± 3.84 ( 57, 68 ) 2.91 ± 0.65 ( 0.28, 6.64 ) 3.03 1.560 1.94
X003d -123.8980 49.04082 7 90.02 ± 6.31 ( 81, 98 ) 1.61 ± 0.33 ( 0.45, 4.06 ) 1.45 2.460 0.59
X003e -123.8966 49.04087 7 91.36 ± 5.72 ( 83, 100 ) 1.45 ± 0.35 ( 0.15, 4.32 ) 1.37 2.460 0.56
X004b -123.9952 49.05755 6 60.73 ± 3.78 ( 56, 67 ) 3.21 ± 0.56 ( 0.15, 10.66 ) 2.84 1.560 1.82
X004d -123.9633 49.05906 8 70.68 ± 9.2 ( 41, 78 ) 1.91 ± 0.18 ( 0.09, 7.04 ) 1.56 2.460 0.63
X005a -124.7889 49.41944 50 63.59 ± 5.58 ( 46, 72 ) 1.79 ± 0.36 ( 0.07, 9.79 ) 1.27 1.785 0.71
X005c -124.7485 49.42990 8 54.49 ± 6.67 ( 42, 64 ) 2.82 ± 0.97 ( 0.15, 12.03 ) 2.22 1.340 1.66
X010c -124.8056 49.42778 31 68.3 ± 2.26 ( 61, 72 ) 1.92 ± 0.37 ( 0.08, 10.98 ) 1.33 1.785 0.75
X010b -124.7406 49.42476 8 61.89 ± 6.72 ( 48, 73 ) 3.67 ± 1.02 ( 0.3, 8.65 ) 3.49 1.340 2.60
X010d -124.8184 49.43054 7 65.89 ± 1.54 ( 63, 68 ) 1.9 ± 0.28 ( 0.08, 8.44 ) 1.35 1.775 0.76
X011a -125.5528 50.04167 28 62.11 ± 6.74 ( 32, 69 ) 2.06 ± 0.44 ( 0.08, 11.42 ) 1.57 1.940 0.81
X011c -125.5210 50.04691 6 68.74 ± 2.24 ( 66, 73 ) 3.14 ± 0.6 ( 0.29, 9.71 ) 2.75 1.855 1.48
X011b -125.5213 50.04673 7 66.18 ± 4.62 ( 59, 73 ) 2.36 ± 0.33 ( 0.08, 6.84 ) 1.99 1.855 1.07
X011d -125.5184 50.06773 8 58.62 ± 2.64 ( 55, 64 ) 2.58 ± 0.69 ( 0.15, 8.93 ) 1.82 1.940 0.94
X012b -125.5709 50.04237 8 56.54 ± 6.35 ( 43, 63 ) 3.36 ± 0.79 ( 0.11, 12.51 ) 2.86 1.855 1.54
X016e -125.4861 49.95278 29 58.7 ± 2.85 ( 48, 64 ) 2.49 ± 0.4 ( 0.1, 9.94 ) 1.89 1.905 0.99
X016c -125.4847 49.94777 8 56.84 ± 3.37 ( 50, 61 ) 3.55 ± 0.77 ( 0.6, 8.77 ) 3.00 1.855 1.62
X016b -125.4950 49.94418 8 57.81 ± 1.79 ( 55, 61 ) 2.11 ± 0.27 ( 0.25, 8.04 ) 1.58 1.940 0.81
X071d -125.5010 50.03760 8 68.97 ± 2.59 ( 64, 72 ) 2.01 ± 0.3 ( 0.24, 6.77 ) 1.76 1.940 0.91



*ratio between median of rw of the site and median of rw of its 10 nearest neighbors.

**The values refer to mean ± sd (min, max)





Correlation and quality assessment code


This table provides a summary for each series, including raw ring width measurements, autocorrelation, correlation with master chronology for both raw and differentiated data, and quality assessment code (qa_code) which was derived from the CFS_qa() function. The master chronology includes all the series with qa_code ‘pass’.


Description of qa_code
qa_code Description
pass The maximum correlation occurs at lag 0
borderline The correlation at lag 0 ranks as the second highest, and its difference from the maximum remains within a predefined threshold, categorizing as a quasi-pass
pm1 The maximum correlation occurs at lag 1 or -1, suggesting slight misalignment.
highpeak The maximum correlation occurs at a non-zero lag and is more than twice the second-highest value, potentially signaling an issue
fail All other measurements that do not fit into the aforementioned categories fall under this classification.


PSEUMEN
site_id radius_id year from year to len series raw AR1* raw corr_mean*& trt AR1** trt corr_mean**& qa_code**%
X003b X003_101_001 1961 2020 60 0.88 0.73 ( 0 ) -0.38 0.54 ( 0 ) pass
X003b X003_101_002 1956 2020 65 0.89 0.93 ( 0 ) -0.40 0.45 ( 0 ) pass
X003b X003_101_003 1965 2020 56 0.87 0.88 ( 0 ) -0.38 0.45 ( 0 ) pass
X003b X003_101_004 1951 2020 70 0.88 0.81 ( 0 ) -0.43 0.51 ( 0 ) pass
X003b X003_101_005 1951 2020 70 0.85 0.85 ( 0 ) -0.36 0.25 ( 0.04 ) Fail
X003b X003_101_006 1952 2020 69 0.88 0.94 ( 0 ) -0.51 0.52 ( 0 ) pass
X003b X003_101_007 1955 2020 66 0.85 0.88 ( 0 ) -0.27 0.34 ( 0.01 ) pass
X003b X003_101_008 1967 2020 54 0.79 0.78 ( 0 ) -0.45 0.51 ( 0 ) pass
X003a X003_102_001 1964 2020 57 0.80 0.88 ( 0 ) -0.07 0.42 ( 0 ) pass
X003a X003_102_002 1953 2020 68 0.92 0.93 ( 0 ) -0.26 0.09 ( 0.49 ) Fail
X003a X003_102_004 1939 2002 64 0.90 0.44 ( 0 ) -0.47 0.02 ( 0.85 ) Fail
X003a X003_102_005 1952 2018 67 0.82 0.31 ( 0.01 ) -0.12 0.1 ( 0.44 ) Fail
X003a X003_102_006 1957 2020 64 0.91 0.95 ( 0 ) -0.32 0.57 ( 0 ) pass
X003a X003_102_007 1954 2020 67 0.85 0.88 ( 0 ) -0.36 0.4 ( 0 ) pass
X003a X003_102_008 1956 2014 59 0.89 0.53 ( 0 ) -0.15 -0.23 ( 0.08 ) Fail
X003d X003_103_001 1931 2019 89 0.73 0.14 ( 0.18 ) -0.12 0.39 ( 0 ) pass
X003d X003_103_002 1936 2020 85 0.55 -0.45 ( 0 ) -0.45 0.08 ( 0.49 ) Fail
X003d X003_103_004 1923 2020 98 0.64 0.17 ( 0.11 ) -0.23 0.2 ( 0.05 ) borderline
X003d X003_103_005 1934 2016 83 0.72 0.32 ( 0 ) -0.39 0.27 ( 0.02 ) pass
X003d X003_103_006 1919 2013 95 0.76 0.44 ( 0 ) -0.28 0.43 ( 0 ) pass
X003d X003_103_007 1940 2020 81 0.84 0.5 ( 0 ) -0.28 0.37 ( 0 ) pass
X003d X003_103_008 1921 2016 96 0.76 0.18 ( 0.08 ) -0.56 0.41 ( 0 ) pass
X003e X003_104_001 1925 2019 95 0.73 0.37 ( 0 ) -0.44 0.23 ( 0.03 ) pass
X003e X003_104_002 1932 2020 89 0.77 0.48 ( 0 ) -0.40 0.26 ( 0.02 ) borderline
X003e X003_104_003 1930 2020 91 0.68 0.12 ( 0.24 ) -0.35 0.28 ( 0.01 ) pass
X003e X003_104_005 1921 2020 100 0.89 0.19 ( 0.06 ) -0.34 0.51 ( 0 ) pass
X003e X003_104_006 1926 2020 95 0.78 0.23 ( 0.03 ) -0.31 0.37 ( 0 ) pass
X003e X003_104_007 1932 2014 83 0.70 0.15 ( 0.18 ) -0.44 0.51 ( 0 ) pass
X003e X003_104_008 1933 2016 84 0.55 0.05 ( 0.64 ) -0.37 0.34 ( 0 ) pass
X004b X004_101_001 1965 2020 56 0.79 0.82 ( 0 ) -0.25 0.4 ( 0 ) pass
X004b X004_101_002 1958 2020 63 0.84 0.94 ( 0 ) -0.33 0.26 ( 0.04 ) Fail
X004b X004_101_003 1960 2020 61 0.92 0.94 ( 0 ) -0.01 0.3 ( 0.02 ) Fail
X004b X004_101_004 1954 2020 67 0.76 0.83 ( 0 ) -0.37 0.64 ( 0 ) pass
X004b X004_101_007 1962 2020 59 0.89 0.94 ( 0 ) -0.06 0.38 ( 0 ) borderline
X004b X004_101_008 1964 2020 57 0.83 0.94 ( 0 ) -0.69 0.62 ( 0 ) pass
X004d X004_104_001 1954 2020 67 0.86 0.84 ( 0 ) -0.34 0.44 ( 0 ) pass
X004d X004_104_002 1945 2020 76 0.77 0.63 ( 0 ) -0.23 0.47 ( 0 ) pass
X004d X004_104_003 1946 1986 41 0.81 0.53 ( 0 ) -0.41 -0.12 ( 0.48 ) Fail
X004d X004_104_004 1952 2020 69 0.85 0.91 ( 0 ) -0.28 0.26 ( 0.03 ) pass
X004d X004_104_005 1951 2020 70 0.67 0.65 ( 0 ) -0.41 0.42 ( 0 ) pass
X004d X004_104_006 1945 2020 76 0.79 0.6 ( 0 ) -0.32 0.33 ( 0 ) pass
X004d X004_104_007 1947 2020 74 0.82 0.88 ( 0 ) -0.25 0.54 ( 0 ) pass
X004d X004_104_008 1943 2020 78 0.90 0.61 ( 0 ) -0.25 0.38 ( 0 ) borderline
X005a X005_001_007 1955 2014 60 0.88 0.97 ( 0 ) -0.48 0.62 ( 0 ) pass
X005a X005_001_011 1949 2020 72 0.94 0.9 ( 0 ) -0.07 0.68 ( 0 ) pass
X005a X005_001_020 1955 2020 66 0.85 0.98 ( 0 ) -0.54 0.81 ( 0 ) pass
X005a X005_001_022 1954 2020 67 0.89 0.97 ( 0 ) -0.28 0.72 ( 0 ) pass
X005a X005_001_031 1954 2007 54 0.81 0.97 ( 0 ) -0.51 0.8 ( 0 ) pass
X005a X005_001_058 1952 2009 58 0.92 0.96 ( 0 ) -0.24 0.72 ( 0 ) pass
X005a X005_001_069 1954 2020 67 0.81 0.91 ( 0 ) -0.35 0.64 ( 0 ) pass
X005a X005_001_075 1975 2020 46 0.42 0.38 ( 0.01 ) -0.12 0.54 ( 0 ) pass
X005a X005_001_107 1953 2020 68 0.83 0.94 ( 0 ) -0.50 0.6 ( 0 ) pass
X005a X005_001_131 1956 2020 65 0.90 0.97 ( 0 ) -0.51 0.85 ( 0 ) pass
X005a X005_001_132 1955 2020 66 0.82 0.93 ( 0 ) -0.60 0.75 ( 0 ) pass
X005a X005_001_141 1954 2008 55 0.82 0.98 ( 0 ) -0.73 0.81 ( 0 ) pass
X005a X005_001_158 1954 2020 67 0.79 0.92 ( 0 ) -0.53 0.7 ( 0 ) pass
X005a X005_001_183 1953 2020 68 0.90 0.97 ( 0 ) -0.55 0.73 ( 0 ) pass
X005a X005_001_192 1955 2003 49 0.84 0.97 ( 0 ) -0.60 0.83 ( 0 ) pass
X005a X005_002_006 1955 2019 65 0.77 0.96 ( 0 ) -0.37 0.81 ( 0 ) pass
X005a X005_002_008 1954 2020 67 0.74 0.96 ( 0 ) -0.58 0.85 ( 0 ) pass
X005a X005_002_024 1953 2019 67 0.77 0.95 ( 0 ) -0.28 0.74 ( 0 ) pass
X005a X005_002_054 1954 2020 67 0.73 0.89 ( 0 ) 0.00 0.55 ( 0 ) pass
X005a X005_002_067 1953 2019 67 0.82 0.96 ( 0 ) -0.46 0.77 ( 0 ) pass
X005a X005_002_123 1953 2020 68 0.90 0.96 ( 0 ) -0.49 0.72 ( 0 ) pass
X005a X005_002_129 1956 2020 65 0.68 0.84 ( 0 ) -0.48 0.83 ( 0 ) pass
X005a X005_002_131 1958 2014 57 0.83 0.94 ( 0 ) -0.65 0.7 ( 0 ) pass
X005a X005_002_146 1951 2015 65 0.92 0.97 ( 0 ) -0.01 0.71 ( 0 ) pass
X005a X005_002_156 1952 2020 69 0.87 0.94 ( 0 ) -0.51 0.72 ( 0 ) pass
X005a X005_002_195 1956 2019 64 0.82 0.96 ( 0 ) -0.43 0.71 ( 0 ) pass
X005a X005_002_197 1954 2020 67 0.83 0.92 ( 0 ) -0.60 0.81 ( 0 ) pass
X005a X005_002_200 1955 2020 66 0.85 0.98 ( 0 ) -0.44 0.84 ( 0 ) pass
X005a X005_008_010 1953 2017 65 0.76 0.87 ( 0 ) -0.51 0.68 ( 0 ) pass
X005a X005_008_101 1954 2019 66 0.83 0.91 ( 0 ) -0.53 0.71 ( 0 ) pass
X005a X005_008_113 1958 2020 63 0.88 0.95 ( 0 ) -0.40 0.64 ( 0 ) pass
X005a X005_008_133 1962 2020 59 0.47 0.61 ( 0 ) -0.46 0.72 ( 0 ) pass
X005a X005_008_151 1951 2013 63 0.92 0.97 ( 0 ) -0.30 0.84 ( 0 ) pass
X005a X005_008_165 1953 2020 68 0.88 0.89 ( 0 ) -0.26 0.7 ( 0 ) pass
X005a X005_008_175 1957 2015 59 0.91 0.95 ( 0 ) -0.32 0.69 ( 0 ) pass
X005a X005_008_200 1956 2020 65 0.79 0.95 ( 0 ) -0.41 0.77 ( 0 ) pass
X005a X005_008_202 1957 2020 64 0.76 0.86 ( 0 ) -0.35 0.71 ( 0 ) pass
X005a X005_008_222 1952 2020 69 0.88 0.92 ( 0 ) -0.32 0.78 ( 0 ) pass
X005a X005_008_244 1955 2020 66 0.80 0.86 ( 0 ) -0.70 0.75 ( 0 ) pass
X005a X005_008_252 1952 2020 69 0.89 0.91 ( 0 ) -0.16 0.66 ( 0 ) pass
X005a X005_010_002 1953 2019 67 0.89 0.94 ( 0 ) -0.61 0.76 ( 0 ) pass
X005a X005_010_004 1961 2014 54 0.85 0.92 ( 0 ) -0.31 0.6 ( 0 ) pass
X005a X005_010_012 1962 2020 59 0.71 0.92 ( 0 ) -0.32 0.63 ( 0 ) pass
X005a X005_010_023 1954 2007 54 0.87 0.95 ( 0 ) -0.62 0.8 ( 0 ) pass
X005a X005_010_045 1955 2019 65 0.72 0.87 ( 0 ) -0.43 0.72 ( 0 ) pass
X005a X005_010_054 1968 2020 53 0.78 0.85 ( 0 ) -0.58 0.14 ( 0.33 ) Fail
X005a X005_010_063 1955 2020 66 0.85 0.9 ( 0 ) -0.41 0.72 ( 0 ) pass
X005a X005_010_077 1957 2020 64 0.70 0.88 ( 0 ) -0.19 0.71 ( 0 ) pass
X005a X005_010_084 1955 2018 64 0.77 0.85 ( 0 ) -0.14 0.56 ( 0 ) pass
X005a X005_010_109 1954 2000 47 0.82 0.96 ( 0 ) -0.48 0.8 ( 0 ) pass
X005c X005_101_001 1964 2009 46 0.92 -0.02 ( 0.92 ) 0.31 0.29 ( 0.06 ) pass
X005c X005_101_002 1960 2016 57 0.90 -0.02 ( 0.9 ) 0.29 0.12 ( 0.38 ) borderline
X005c X005_101_003 1979 2020 42 0.88 -0.02 ( 0.9 ) 0.11 0.42 ( 0.01 ) pass
X005c X005_101_004 1967 2020 54 0.90 -0.27 ( 0.05 ) 0.15 0.38 ( 0.01 ) pass
X005c X005_101_005 1957 2020 64 0.92 -0.45 ( 0 ) -0.01 0.15 ( 0.23 ) borderline
X005c X005_101_006 1966 2018 53 0.80 -0.25 ( 0.07 ) -0.37 0.4 ( 0 ) pass
X005c X005_101_007 1968 2019 52 0.91 0.1 ( 0.48 ) 0.07 0.27 ( 0.06 ) borderline
X005c X005_101_008 1960 2020 61 0.93 -0.52 ( 0 ) 0.17 0.23 ( 0.08 ) pass
X010c X010_001_014 1953 2020 68 0.84 0.96 ( 0 ) -0.35 0.65 ( 0 ) pass
X010c X010_001_023 1952 2020 69 0.89 0.94 ( 0 ) -0.50 0.03 ( 0.78 ) Fail
X010c X010_001_061 1954 2020 67 0.74 0.81 ( 0 ) -0.41 0.78 ( 0 ) pass
X010c X010_001_108 1954 2020 67 0.79 0.9 ( 0 ) -0.36 0.64 ( 0 ) pass
X010c X010_001_120 1956 2020 65 0.78 0.96 ( 0 ) -0.22 0.79 ( 0 ) pass
X010c X010_001_136 1953 2020 68 0.85 0.98 ( 0 ) -0.48 0.79 ( 0 ) pass
X010c X010_001_161 1952 2020 69 0.90 0.93 ( 0 ) -0.47 0.86 ( 0 ) pass
X010c X010_001_196 1953 2020 68 0.92 0.97 ( 0 ) -0.35 0.72 ( 0 ) pass
X010c X010_002_066 1953 2020 68 0.87 0.9 ( 0 ) -0.53 0.78 ( 0 ) pass
X010c X010_002_130 1954 2020 67 0.84 0.93 ( 0 ) -0.54 0.82 ( 0 ) pass
X010c X010_002_140 1955 2018 64 0.69 0.91 ( 0 ) -0.22 0.68 ( 0 ) pass
X010c X010_002_195 1955 2020 66 0.84 0.96 ( 0 ) -0.52 0.82 ( 0 ) pass
X010c X010_002_205 1953 2020 68 0.91 0.98 ( 0 ) -0.56 0.78 ( 0 ) pass
X010c X010_002_218 1952 2020 69 0.90 0.96 ( 0 ) -0.19 0.6 ( 0 ) pass
X010c X010_002_272 1952 2020 69 0.85 0.91 ( 0 ) -0.43 0.81 ( 0 ) pass
X010c X010_002_288 1950 2020 71 0.91 0.92 ( 0 ) -0.47 0.68 ( 0 ) pass
X010c X010_006_003 1953 2020 68 0.82 0.95 ( 0 ) -0.58 0.81 ( 0 ) pass
X010c X010_006_016 1949 2020 72 0.85 0.93 ( 0 ) -0.27 0.68 ( 0 ) pass
X010c X010_006_053 1952 2020 69 0.82 0.76 ( 0 ) -0.14 0.53 ( 0 ) pass
X010c X010_006_081 1951 2020 70 0.85 0.96 ( 0 ) -0.58 0.78 ( 0 ) pass
X010c X010_006_107 1954 2020 67 0.88 0.96 ( 0 ) -0.62 0.79 ( 0 ) pass
X010c X010_006_110 1949 2020 72 0.85 0.92 ( 0 ) -0.46 0.68 ( 0 ) pass
X010c X010_006_139 1951 2016 66 0.84 0.93 ( 0 ) -0.43 0.58 ( 0 ) pass
X010c X010_010_740 1950 2020 71 0.93 0.93 ( 0 ) -0.29 0.82 ( 0 ) pass
X010c X010_010_754 1950 2020 71 0.91 0.92 ( 0 ) -0.22 0.79 ( 0 ) pass
X010c X010_010_790 1952 2020 69 0.84 0.87 ( 0 ) -0.39 0.68 ( 0 ) pass
X010c X010_010_817 1952 2020 69 0.85 0.95 ( 0 ) -0.42 0.82 ( 0 ) pass
X010c X010_010_845 1950 2020 71 0.82 0.87 ( 0 ) -0.50 0.73 ( 0 ) pass
X010c X010_010_854 1953 2020 68 0.78 0.93 ( 0 ) -0.11 0.52 ( 0 ) pass
X010c X010_010_863 1960 2020 61 0.86 0.91 ( 0 ) -0.30 0.62 ( 0 ) pass
X010c X010_010_891 1953 2020 68 0.86 0.95 ( 0 ) -0.69 0.77 ( 0 ) pass
X010b X010_102_001 1948 2020 73 0.87 -0.09 ( 0.45 ) 0.19 0.25 ( 0.03 ) pass
X010b X010_102_002 1961 2020 60 0.85 0.6 ( 0 ) -0.20 0.54 ( 0 ) pass
X010b X010_102_003 1973 2020 48 0.64 0.64 ( 0 ) -0.39 0.42 ( 0 ) pass
X010b X010_102_004 1956 2020 65 0.67 0.42 ( 0 ) -0.22 0.38 ( 0 ) pass
X010b X010_102_005 1961 2020 60 0.76 0.85 ( 0 ) -0.28 0.32 ( 0.02 ) pass
X010b X010_102_006 1955 2020 66 0.76 0.81 ( 0 ) -0.11 0.36 ( 0 ) pass
X010b X010_102_007 1964 2020 57 0.86 0.7 ( 0 ) -0.11 0.36 ( 0.01 ) pass
X010b X010_102_008 1961 2020 60 0.79 0.51 ( 0 ) -0.09 0.46 ( 0 ) pass
X010d X010_104_001 1956 2020 65 0.89 0.97 ( 0 ) -0.30 0.76 ( 0 ) pass
X010d X010_104_002 1954 2020 67 0.85 0.97 ( 0 ) -0.56 0.83 ( 0 ) pass
X010d X010_104_003 1956 2020 65 0.91 0.96 ( 0 ) -0.40 0.72 ( 0 ) pass
X010d X010_104_005 1958 2020 63 0.73 0.9 ( 0 ) -0.29 0.25 ( 0.05 ) Fail
X010d X010_104_006 1953 2020 68 0.86 0.94 ( 0 ) -0.47 0.71 ( 0 ) pass
X010d X010_104_007 1955 2020 66 0.85 0.9 ( 0 ) -0.54 -0.26 ( 0.04 ) Fail
X010d X010_104_008 1954 2020 67 0.87 0.98 ( 0 ) -0.29 0.69 ( 0 ) pass
X011a X011_001_054 1957 2016 60 0.76 0.92 ( 0 ) -0.39 0.77 ( 0 ) pass
X011a X011_001_068 1955 2020 66 0.89 0.95 ( 0 ) -0.46 0.79 ( 0 ) pass
X011a X011_001_077 1956 2020 65 0.67 0.9 ( 0 ) -0.27 0.54 ( 0 ) pass
X011a X011_001_092 1957 2008 52 0.86 0.95 ( 0 ) -0.34 0.76 ( 0 ) pass
X011a X011_001_112 1959 2020 62 0.85 0.96 ( 0 ) -0.51 0.61 ( 0 ) pass
X011a X011_001_132 1952 2020 69 0.82 0.84 ( 0 ) -0.20 0.77 ( 0 ) pass
X011a X011_001_149 1957 2020 64 0.72 0.64 ( 0 ) -0.42 0.41 ( 0 ) borderline
X011a X011_001_169 1957 2020 64 0.82 0.95 ( 0 ) -0.44 0.79 ( 0 ) pass
X011a X011_004_032 1979 2012 34 0.74 0.86 ( 0 ) -0.69 0.55 ( 0 ) pass
X011a X011_004_067 1953 2020 68 0.83 0.91 ( 0 ) -0.53 0.77 ( 0 ) pass
X011a X011_004_079 1958 2020 63 0.84 0.92 ( 0 ) -0.42 0.73 ( 0 ) pass
X011a X011_004_111 1956 2016 61 0.92 0.93 ( 0 ) -0.32 0.68 ( 0 ) pass
X011a X011_004_122 1954 2011 58 0.87 0.97 ( 0 ) -0.16 0.52 ( 0 ) pass
X011a X011_004_129 1989 2020 32 0.88 0.81 ( 0 ) -0.10 0.61 ( 0 ) pass
X011a X011_004_149 1957 2020 64 0.75 0.9 ( 0 ) -0.43 0.78 ( 0 ) pass
X011a X011_005_019 1956 2020 65 0.89 0.91 ( 0 ) -0.10 0.66 ( 0 ) pass
X011a X011_005_021 1955 2020 66 0.78 0.9 ( 0 ) -0.21 0.7 ( 0 ) pass
X011a X011_005_071 1953 2020 68 0.89 0.91 ( 0 ) -0.53 0.71 ( 0 ) pass
X011a X011_005_094 1959 2020 62 0.81 0.93 ( 0 ) -0.26 0.64 ( 0 ) pass
X011a X011_005_114 1956 2015 60 0.79 0.95 ( 0 ) -0.22 0.42 ( 0 ) pass
X011a X011_005_133 1957 2020 64 0.49 0.87 ( 0 ) -0.48 0.86 ( 0 ) pass
X011a X011_008_119 1957 2020 64 0.75 0.9 ( 0 ) -0.28 0.84 ( 0 ) pass
X011a X011_008_134 1961 2020 60 0.79 0.92 ( 0 ) -0.29 0.77 ( 0 ) pass
X011a X011_008_140 1954 2017 64 0.82 0.9 ( 0 ) -0.32 0.69 ( 0 ) pass
X011a X011_008_161 1954 2014 61 0.89 0.93 ( 0 ) -0.46 0.71 ( 0 ) pass
X011a X011_008_229 1954 2020 67 0.83 0.92 ( 0 ) -0.55 0.64 ( 0 ) pass
X011a X011_008_250 1958 2020 63 0.80 0.94 ( 0 ) -0.33 0.74 ( 0 ) pass
X011a X011_008_288 1961 2020 60 0.85 0.87 ( 0 ) -0.42 0.11 ( 0.41 ) Fail
X011c X011_101_002 1955 2020 66 0.89 0.91 ( 0 ) -0.13 0.63 ( 0 ) pass
X011c X011_101_004 1951 2019 69 0.89 0.85 ( 0 ) -0.16 0.54 ( 0 ) pass
X011c X011_101_005 1953 2020 68 0.91 0.93 ( 0 ) -0.35 0.52 ( 0 ) pass
X011c X011_101_006 1952 2020 69 0.84 0.89 ( 0 ) -0.37 0.17 ( 0.16 ) Fail
X011c X011_101_007 1954 2020 67 0.82 0.89 ( 0 ) -0.31 0.65 ( 0 ) pass
X011c X011_101_008 1948 2020 73 0.91 0.94 ( 0 ) -0.21 0.61 ( 0 ) pass
X011b X011_102_002 1962 2020 59 0.50 0.52 ( 0 ) -0.34 0.48 ( 0 ) pass
X011b X011_102_003 1958 2020 63 0.89 0.87 ( 0 ) -0.19 0.63 ( 0 ) pass
X011b X011_102_004 1952 2020 69 0.91 0.96 ( 0 ) -0.42 0.85 ( 0 ) pass
X011b X011_102_005 1950 2019 70 0.93 0.95 ( 0 ) -0.29 0.67 ( 0 ) pass
X011b X011_102_006 1959 2020 62 0.77 0.9 ( 0 ) -0.33 0.77 ( 0 ) pass
X011b X011_102_007 1956 2020 65 0.90 0.95 ( 0 ) -0.27 0.65 ( 0 ) pass
X011b X011_102_008 1948 2020 73 0.91 0.94 ( 0 ) -0.21 0.61 ( 0 ) pass
X011d X011_104_001 1957 2020 64 0.90 0.94 ( 0 ) -0.46 0.71 ( 0 ) pass
X011d X011_104_002 1963 2020 58 0.81 0.87 ( 0 ) -0.60 0.64 ( 0 ) pass
X011d X011_104_003 1965 2020 56 0.88 0.94 ( 0 ) -0.41 0.81 ( 0 ) pass
X011d X011_104_004 1964 2020 57 0.82 0.94 ( 0 ) -0.59 0.75 ( 0 ) pass
X011d X011_104_005 1966 2020 55 0.84 0.93 ( 0 ) -0.48 0.69 ( 0 ) pass
X011d X011_104_006 1961 2020 60 0.81 0.9 ( 0 ) -0.49 0.82 ( 0 ) pass
X011d X011_104_007 1962 2020 59 0.84 0.95 ( 0 ) -0.57 0.74 ( 0 ) pass
X011d X011_104_008 1962 2020 59 0.80 0.91 ( 0 ) -0.56 0.8 ( 0 ) pass
X012b X012_102_001 1978 2020 43 0.82 0.85 ( 0 ) -0.42 0.56 ( 0 ) pass
X012b X012_102_002 1963 2015 53 0.77 0.97 ( 0 ) -0.24 0.85 ( 0 ) pass
X012b X012_102_003 1958 2020 63 0.86 0.9 ( 0 ) -0.36 0.02 ( 0.91 ) Fail
X012b X012_102_004 1965 2020 56 0.61 0.8 ( 0 ) -0.48 0.79 ( 0 ) pass
X012b X012_102_005 1960 2020 61 0.76 0.84 ( 0 ) -0.25 0.58 ( 0 ) pass
X012b X012_102_006 1963 2020 58 0.66 0.84 ( 0 ) -0.48 0.67 ( 0 ) pass
X012b X012_102_007 1958 2020 63 0.81 0.92 ( 0 ) -0.18 0.75 ( 0 ) pass
X012b X012_102_008 1965 2013 49 0.78 0.9 ( 0 ) -0.57 0.71 ( 0 ) pass
X016e X016_002_167 1965 2020 56 0.76 0.93 ( 0 ) -0.26 0.4 ( 0 ) pass
X016e X016_002_172 1963 2020 58 0.74 0.93 ( 0 ) -0.33 0.82 ( 0 ) pass
X016e X016_002_214 1963 2020 58 0.71 0.86 ( 0 ) -0.19 0.62 ( 0 ) pass
X016e X016_002_241 1962 2020 59 0.80 0.88 ( 0 ) -0.23 0.69 ( 0 ) pass
X016e X016_002_267 1960 2020 61 0.92 0.95 ( 0 ) -0.11 0.37 ( 0 ) borderline
X016e X016_002_270 1966 2020 55 0.76 0.81 ( 0 ) -0.21 0.19 ( 0.18 ) Fail
X016e X016_002_276 1962 2020 59 0.89 0.98 ( 0 ) -0.61 0.83 ( 0 ) pass
X016e X016_002_294 1963 2020 58 0.77 0.94 ( 0 ) -0.49 0.86 ( 0 ) pass
X016e X016_003_162 1960 2020 61 0.88 0.95 ( 0 ) -0.47 0.71 ( 0 ) pass
X016e X016_003_169 1960 2020 61 0.87 0.95 ( 0 ) -0.07 0.72 ( 0 ) pass
X016e X016_003_211 1965 2020 56 0.86 0.96 ( 0 ) -0.41 0.73 ( 0 ) pass
X016e X016_003_219 1962 2020 59 0.74 0.93 ( 0 ) -0.51 0.86 ( 0 ) pass
X016e X016_003_252 1959 2020 62 0.93 0.95 ( 0 ) -0.25 0.58 ( 0 ) pass
X016e X016_003_268 1961 2020 60 0.84 0.87 ( 0 ) -0.44 0.71 ( 0 ) pass
X016e X016_003_284 1962 2020 59 0.86 0.94 ( 0 ) -0.60 0.78 ( 0 ) pass
X016e X016_003_297 1961 2020 60 0.86 0.86 ( 0 ) -0.39 0.74 ( 0 ) pass
X016e X016_006_216 1962 2020 59 0.83 0.91 ( 0 ) -0.27 0.75 ( 0 ) pass
X016e X016_006_235 1962 2020 59 0.84 0.94 ( 0 ) -0.36 0.79 ( 0 ) pass
X016e X016_006_267 1966 2020 55 0.86 0.88 ( 0 ) -0.45 0.52 ( 0 ) pass
X016e X016_006_278 1964 2020 57 0.79 0.92 ( 0 ) -0.11 0.62 ( 0 ) pass
X016e X016_006_299 1961 2020 60 0.89 0.95 ( 0 ) -0.37 0.8 ( 0 ) pass
X016e X016_006_981 1961 2020 60 0.90 0.93 ( 0 ) -0.32 0.74 ( 0 ) pass
X016e X016_007_008 1961 2020 60 0.82 0.91 ( 0 ) -0.33 0.66 ( 0 ) pass
X016e X016_007_047 1973 2020 48 0.52 0.69 ( 0 ) 0.04 0.53 ( 0 ) pass
X016e X016_007_066 1964 2020 57 0.80 0.94 ( 0 ) -0.31 0.79 ( 0 ) pass
X016e X016_007_087 1959 2020 62 0.87 0.87 ( 0 ) -0.14 0.42 ( 0 ) borderline
X016e X016_007_095 1964 2018 55 0.85 0.95 ( 0 ) -0.48 0.63 ( 0 ) pass
X016e X016_007_229 1961 2020 60 0.70 0.87 ( 0 ) -0.27 0.69 ( 0 ) pass
X016e X016_007_252 1957 2020 64 0.94 0.93 ( 0 ) -0.02 0.44 ( 0 ) pass
X016c X016_101_001 1963 2020 58 0.51 0.61 ( 0 ) -0.32 0.67 ( 0 ) pass
X016c X016_101_002 1969 2020 52 0.67 0.79 ( 0 ) -0.31 0.52 ( 0 ) pass
X016c X016_101_003 1962 2020 59 0.87 0.95 ( 0 ) -0.44 0.82 ( 0 ) pass
X016c X016_101_004 1964 2020 57 0.73 0.9 ( 0 ) -0.34 0.65 ( 0 ) pass
X016c X016_101_005 1963 2020 58 0.87 0.93 ( 0 ) -0.46 0.8 ( 0 ) pass
X016c X016_101_006 1971 2020 50 0.83 0.93 ( 0 ) -0.34 0.48 ( 0 ) pass
X016c X016_101_007 1963 2020 58 0.78 0.92 ( 0 ) -0.40 0.54 ( 0 ) pass
X016c X016_101_008 1960 2020 61 0.87 0.86 ( 0 ) -0.36 0.57 ( 0 ) borderline
X016b X016_104_001 1963 2020 58 0.79 0.96 ( 0 ) -0.53 0.58 ( 0 ) pass
X016b X016_104_002 1960 2020 61 0.79 0.87 ( 0 ) -0.38 0.73 ( 0 ) pass
X016b X016_104_003 1965 2019 55 0.84 0.28 ( 0.04 ) -0.21 0.57 ( 0 ) pass
X016b X016_104_004 1962 2020 59 0.83 0.77 ( 0 ) -0.61 0.76 ( 0 ) pass
X016b X016_104_005 1964 2020 57 0.89 0.7 ( 0 ) -0.40 0.76 ( 0 ) pass
X016b X016_104_006 1965 2020 56 0.89 0.94 ( 0 ) -0.32 0.71 ( 0 ) pass
X016b X016_104_007 1962 2020 59 0.85 0.91 ( 0 ) -0.48 0.63 ( 0 ) pass
X016b X016_104_008 1964 2020 57 0.84 0.93 ( 0 ) -0.46 0.8 ( 0 ) pass
X071d X071_104_001 1949 2020 72 0.88 0.89 ( 0 ) -0.32 0.75 ( 0 ) pass
X071d X071_104_002 1949 2020 72 0.82 0.91 ( 0 ) -0.31 0.73 ( 0 ) pass
X071d X071_104_003 1957 2020 64 0.75 0.88 ( 0 ) -0.52 0.42 ( 0 ) borderline
X071d X071_104_004 1952 2020 69 0.82 0.86 ( 0 ) -0.33 0.63 ( 0 ) pass
X071d X071_104_005 1951 2018 68 0.88 0.86 ( 0 ) -0.48 0.67 ( 0 ) pass
X071d X071_104_006 1951 2020 70 0.87 0.93 ( 0 ) -0.35 0.77 ( 0 ) pass
X071d X071_104_007 1955 2020 66 0.78 0.94 ( 0 ) -0.52 0.68 ( 0 ) pass
X071d X071_104_008 1951 2020 70 0.89 0.97 ( 0 ) -0.40 0.71 ( 0 ) pass



*developed from raw series

**developed from differentiated series

&correlation with master chronology, the value represents correlation (p-value)
%qa_code is identified using the current data as reference dataset



3. Quality Assessment

Ensuring the quality of data measurements is critical to the success of any data collection effort. In this work, particular attention is given to the possibility of measurement errors and incorrect data transformations, as these can distort tree-ring width values and consequently impact downstream analyses.

3.1 data scale

Ring-width measurements from certain sites may occasionally appear unusually high or low, often due to transformation errors, as tree-ring data is usually stored as integers with an associated scale factor. The CFS_scale() function addresses this by applying a k-nearest neighbors (k-NN) approach, using geodesic distances on the WGS84 ellipsoid (via the distGeo function from the geosphere package), to identify geographically close sites. It then compares the median tree-ring measurements of the target site to those of its nearest neighbors. This procedure is conducted within the same species.

arguments of CFS_scale() function:

target_site

The target site refers to a single site to be evaluated and includes at least five columns: species, uid_site, site_id, latitude, and longitude.

ref_sites

The reference sites refer to a dataset of ring-width measurements that includes the target site. In addition to the columns present in the target site, the dataset also contains uid_radius, year, and rw_mm.

scale.label_data_ref

a short description of reference dataset.This text will appear in the report as the data source for the generated figures.

scale.N_nbs

This specifies the maximum number of neighbors to be considered in the procedure.

scale.max_dist_km

This specifies the maximum distance (in kilometers) for searching neighbors of the target site.

generate report:

outfile_scale <- tempfile(fileext = ".html")
generate_report(robj = dt.scale, output_file = outfile_scale)


arguments of the generate_report() function:

robj

The input for the scale report is the output of the CFS_scale() function, which assigns the class “cfs_scale” to the resulting object.

Quality Report: ring width measurement



This report compares the median ring-width of the target site X003b with its 10 nearest neighbors in the dataset CFSTRenD V1.2-proj69 , using a maximum search distance of 20 km.



3.2 cross-dating

Tree-ring measurements often exhibit long-term growth trends and interannual variability, which can obscure short-term anomalies and complicate the assessment of data quality (e.g., Bunn 2008; Holmes 1983). Measurement instruments may also introduce inaccuracies due to their limitations. The aim of this exercise is to identify and classify whether ring-width measurements are accurate by using the cross-correlation function (CCF) applied to a treated series (consecutive differences).

arguments of CFS_qa() function:

dt.input

The input dataset must include at least five columns: species, SampleID, Year, RawRing, and RW_trt. SampleID identifies each series, RawRing contains the raw ring-width measurements in millimeters, and RW_trt contains transformed measurements suitable for constructing a master chronology, according to the user’s choice. In this example, consecutive differences of the series were used for RW_trt.

qa.label_data

a short description of the input dataset.This text will appear in the report as data source for the generated figures.

qa.label_trt

a short description of the treated series.This text will appear in the report.

generate report:

dt.qa$dt.ccf[qa_code != "pass"]
outfile_qa <- tempfile(fileext = ".html")
generate_report(robj = dt.qa,  qa.out_series = c("X003_101_005", "X011_104_003", "X016_104_003"), output_file = outfile_qa)
arguments of the generate_report() function:

robj

The input for the cross-dating report is the output of the CFS_qa() function, which assigns the class “cfs_qa” to the resulting object.

qa.out_series

This argument allows users to select which series to examine visually. By default, all series are included, which may result in unnecessarily long processing times.
Quality Report: cross-dating



This report provides an overview of the quality of each series with 4 graphs:

  1. raw ring measurement vs. year;

  2. cross-correlation plots of raw ring measurement with master chronology (raw)

  3. treated ring measurement vs. year;

  4. cross-correlation plots of treated ring measurement with master chronology (treated). “qa_code” is attached to this plot.

below is the description of qa_code.


Description of qa_code
qa_code Description
pass The maximum correlation occurs at lag 0
borderline The correlation at lag 0 ranks as the second highest, and its difference from the maximum remains within a predefined threshold, categorizing as a quasi-pass
pm1 The maximum correlation occurs at lag 1 or -1, suggesting slight misalignment.
highpeak The maximum correlation occurs at a non-zero lag and is more than twice the second-highest value, potentially signaling an issue
fail All other measurements that do not fit into the aforementioned categories fall under this classification.



parameters used in this report:

data source: CFSTRenD V1.2-proj69

treated series: difference

threshold for borderline: 0.1

minimum number of series for developping master chronology: 100




4. Detrending and Modeling

GAMMs handle nonlinear responses and can include random effects (e.g., site or tree identity) to account for hierarchical structures and temporal or spatial dependencies, making them well-suited for modeling complex dendrochronological data. in CFSTRenD package, a suite of GAM and GAMM models has been implemented to accommodate different types of datasets. Here, we use one model, gamm_spatial, to demonstrate how to generate a fitting and diagnostic model report.

predata and fitting:

arguments of gamm_spatial:

resp_scale m.candidates


outfile_mod <- tempfile(fileext = ".html")
generate_report(robj = m.sp, output_file = outfile_mod)
arguments of the generate_report() function:

robj

The input for the cross-dating report is the output of the CFS_qa() function, which assigns the class “cfs_qa” to the resulting object.

Generalized Additive Model Analysis Report


This report presents the results of a generalized additive model (GAM) analysis.
The objective is to evaluate predictor contributions, describe the functional forms of relationships,
and assess the adequacy of the fitted model.
The following sections include a model summary, smooth term importance, partial effect visualizations,
and diagnostic checks to ensure the robustness of the analysis.


Model Summary

The following output provides the summary of the fitted GAM model.
It includes estimated coefficients, smooth terms, approximate significance of predictors,
and overall model fit statistics.

#> 
#> Family: gaussian 
#> Link function: identity 
#> 
#> Formula:
#> log(bai_cm2) ~ log(ba_cm2_t_1) + s(ageC) + s(FFD) + s(uid_site.fac, 
#>     bs = "re")
#> 
#> Parametric coefficients:
#>                 Estimate Std. Error t value Pr(>|t|)    
#> (Intercept)     -3.36110    0.16585  -20.27   <2e-16 ***
#> log(ba_cm2_t_1)  1.00098    0.02725   36.74   <2e-16 ***
#> ---
#> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#> 
#> Approximate significance of smooth terms:
#>                    edf Ref.df      F p-value    
#> s(ageC)          7.727  7.727 197.45  <2e-16 ***
#> s(FFD)           8.202  8.202  78.30  <2e-16 ***
#> s(uid_site.fac) 16.529 19.000   8.09  <2e-16 ***
#> ---
#> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#> 
#> R-sq.(adj) =   0.69   
#>   Scale est. = 0.14552   n = 13272


Importance of Smooth Terms

The relative contribution of predictors is evaluated by calculating the importance percentage of each smooth term, based on ssq method. This indicates how much each variable contributes to explaining variation in the response.

Relative importance of smooth terms based on deviance partitioning.
Term Score (%)
s(ageC) 90.8
s(uid_site.fac) 8.6
s(FFD) 0.6



Partial Effects of Smooth Terms

Partial effect plots illustrate the shape of the relationship between the response and each predictor, while holding other predictors constant. These visualizations help identify nonlinear trends and assess whether effects are monotonic, threshold-like, or more complex.


Model Diagnostics

Diagnostic checks evaluate whether the fitted GAM meets assumptions of independence, normality, and sufficient smoothness. Residuals, k-index, and qq-plots provide evidence of model adequacy or potential overfitting.

#> 
#> 'gamm' based fit - care required with interpretation.
#> Checks based on working residuals may be misleading.
#> Basis dimension (k) checking results. Low p-value (k-index<1) may
#> indicate that k is too low, especially if edf is close to k'.
#> 
#>                    k'   edf k-index p-value    
#> s(ageC)          9.00  7.73    1.00    0.46    
#> s(FFD)           9.00  8.20    0.94  <2e-16 ***
#> s(uid_site.fac) 20.00 16.53      NA      NA    
#> ---
#> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Conclusion

This vignette illustrated a typical workflow with CFSTRenD: 1. Load and inspect data 2. Perform quality checks 3. Detrend and model growth 4. Visualize and generate reports

For detailed examples and templates, see the package inst/rmd folder.


References

  • Girardin et al., CFS-TRenD: A National Tree-Ring Data Repository, 2021
  • Bunn, Statistical Methods in Dendrochronology, 2008